home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol3 / snip_plasmafire.dba < prev    next >
Encoding:
Text File  |  2000-09-28  |  1.9 KB  |  107 lines

  1. `    -------------------------------------------------------------------------
  2. `    Plasma Fire                                   DarkForge Snippet 27/9/2000
  3. `    -------------------------------------------------------------------------
  4. `    Developed on a Pentium3-850 with GeForce 256 DDR but worked okay on less!
  5. `    Needs low resolution for speed though. Press the left and right mouse
  6. `    buttons during the program to "paint" on-screen. Directions are inversed.
  7.  
  8. set display mode 320,240,16
  9.  
  10. hide mouse
  11. sync rate 0
  12. sync on
  13.  
  14. `    Build a small DarkForge logo (image 1)
  15.  
  16. set text font "Terminal"
  17.  
  18. for a=1 to 5
  19.     ink rgb(25*a,25*a,25*a),0
  20.     text a,0,"DARKFORGE"
  21. next a
  22.  
  23. ink rgb(255,255,255),0
  24. text 5,0,"DARKFORGE"
  25.  
  26. get image 1,4,1,56,8
  27.  
  28. cls 0
  29.  
  30. `    Create our working bitmaps (1 for blur, 2 for flip)
  31.  
  32. create bitmap 2,180,60
  33. create bitmap 1,180,60
  34.  
  35. `    Set a few variables, i for ink and fp for firepaint value
  36.  
  37. i=0
  38. fp=6
  39.  
  40. position mouse 0,0
  41.  
  42. do
  43.  
  44.     set current bitmap 1
  45.  
  46.     for a=0 to 5
  47.  
  48.         if black=1
  49.  
  50.             ink rgb(0,0,0),0
  51.  
  52.         else
  53.  
  54. `            Uncomment these for various colour effects or make your own!
  55.  
  56. `            ink rgb(i,75,i/2),0
  57. `            ink rgb(i,10,i/2),0
  58. `            ink rgb(255,i,255),0
  59. `            ink rgb(150+i,50+i,i),0
  60.             ink rgb(150+i,50+i,i/2),0
  61.  
  62.         endif
  63.         circle rnd(180),0,8
  64.  
  65.     next a
  66.  
  67.     inc i
  68.     if i<255 then i=255
  69.  
  70.     inc blacktimer
  71.     if blacktimer=350 then black=1
  72.  
  73.     if blacktimer>425
  74.         blacktimer=0
  75.         black=0
  76.         i=0
  77.     endif
  78.  
  79.     if mouseclick()=1
  80.         mx=mousex()
  81.         my=mousey()
  82.         ink rgb(155,155,155),0
  83.         for a=0 to fp
  84.             offset=rnd(12)
  85.             box mx+offset,my+offset,(mx+offset)+2,(my+offset)+2
  86.         next a
  87.     endif
  88.  
  89.     if mouseclick()=2
  90.         mx=mousex()
  91.         my=mousey()
  92.         ink rgb(255,255,255),0
  93.         circle mx,my,6
  94.     endif
  95.  
  96.     blur bitmap 1,1
  97.     copy bitmap 1,0,9,179,59,2,0,0,179,59
  98.     flip bitmap 2
  99.     copy bitmap 2,0,0,179,59,0,0,0,319,239
  100.     set current bitmap 0
  101.     paste image 1,0,0
  102.  
  103.     sync
  104.  
  105. loop
  106.  
  107.